#include <bits/stdc++.h>
using namespace std;
const int maxn = 200+5, maxs = 1<<15, INF = 0x3f3f3f3f;
int d[maxn][maxn], L[15+2], dp[maxs][15+2];
int n, m, R;

inline bool done(int s){
    int t = s&(-s);
    return (s^t)==0;
}

int dfs(int s, int u){
    int &ans = dp[s][u];
    if(ans < INF) return ans;
    if(done(s)) return 0;
    int ss = s^(1<<u);
    for (int i = 0; i < R; ++i) {
        if(ss & (1<<i)){
            ans = min(ans, d[L[i]][L[u]] + dfs(ss, i));
        }
    }
    return ans;
}

int main() {
    ios::sync_with_stdio(false), cin.tie(nullptr);
    memset(dp, INF, sizeof(dp));
    memset(d, INF, sizeof(d));
    cin >> n >> m >> R;
    for (int i = 0; i < R; ++i) {
        cin >> L[i];
    }
    for (int i = 0; i < m; ++i) {
        int a, b, w;
        cin >> a >> b >> w;
        d[a][b] = d[b][a] = w;
    }
    for (int k = 1; k <= n; ++k) {
        for (int i = 1; i <= n; ++i) {
            for (int j = 1; j <= n; ++j) if(i!=j){
                d[i][j] = min(d[i][j], d[i][k]+d[k][j]);
            }
        }
    }
    int ans = INF;
    for (int i = 0; i < R; ++i) {
        ans = min(ans, dfs((1<<R)-1, i));
    }

    cout << ans;
    return 0;
}
